#       pack.sh
#       
#       Copyright 2008 Edwood Ocasio <edwood.ocasio@gae.cayey.upr.edu>
#       
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#       
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#       
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.
#! /bin/bash

# Packing script

# Sets package name
version=$(cat VERSION)
package="uprgae_console-"$version".tar.gz"
packagezip="uprgae_console-"$version".zip"

# Resets gaeconf 
echo Resetting gaeconf
echo "email=
lang=en
title=<This title line can be customized in file 'gaeconf'>
prompt=" > gaeconf

echo Generating uprgae documentation
# Generates module documentation as text and html
pydoc ./uprgae.py > uprgae.txt
pydoc -w ./uprgae.py

# Generates module documentation as text and html
pydoc ./reporting.py > reporting.txt
pydoc -w ./reporting.py

echo Compressing into $package and $packagezip

# Compresses packages (tar.gz and zip)
tar zcvvf $package --exclude=*.svn *.py *.txt changelog gaeconf *.html *.csv locale uprgae.pot
zip -r $packagezip  *.py *.txt changelog gaeconf *.html *.csv locale uprgae.pot
